

use  "$data/clean/vignette.dta", clear



reshape long  prob_join_ prob_camp_, i(id) j(treat)

loc experiments "prob_join_  prob_camp_"
		   
		   
preserve

clear all
eststo clear
estimates drop _all

set obs 10
qui gen x = 1
qui gen y = 1

loc columns = 0

foreach choice in `experiments' {

    loc ++columns
    qui eststo col`columns': reg x y

}

restore


/* Statistics */

loc colnum = 1
loc colnames ""


foreach choice in `experiments' {

/* Statistics */



 
 
********************************Panel A*****************************************
	
    reg `choice'  treat, cluster(id) 
    sigstar treat  , prec(3)
    estadd loc thisstat3 = "`r(bstar)'": col`colnum'
    estadd loc thisstat4 = "`r(sestar)'": col`colnum'

		
		 
	qui sum `choice' if treat==0
	

	estadd loc thisstat6 = string(`r(mean)', "%9.2f"): col`colnum'
	
	qui sum `choice' 
    estadd loc thisstat7 = string(`r(N)', "%9.0f"): col`colnum'
	
	
	
    loc ++colnum
    loc colnames "`colnames' `"`: var la `choice''"'"
	

	

	}
	

loc rowlabels " " " "  " "Improved voice" " " " " " \hline Mean status quo" "Number of Observations"  "

loc rowstats ""

forval i = 1/7 {
    loc rowstats "`rowstats' thisstat`i'"
}



esttab col* using "$output/vignette_regression.tex", replace cells(none) booktabs nonotes nonum compress alignment(c) nogap noobs nobaselevels label stats(`rowstats', labels(`rowlabels')) ///
  mtitle("Probability of joining the party" "Probability of joining the campaign")
